package com.io;

import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.nio.charset.StandardCharsets;

public class OutPutStreamClass {
    public static void main(String[] args) {
        try {
            OutputStream outputStream = new FileOutputStream("out/readme.txt");
            outputStream.write(90);
            outputStream.write(50);
            outputStream.close();

            writeFile();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    public static void writeFile() throws IOException {
        try(OutputStream outputStream = new FileOutputStream("out/readme1.txt")) {
            outputStream.write("Hello".getBytes(StandardCharsets.UTF_8));
        }
    }
}
